<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>GitHub Issue 1536</title>
    <link rel="stylesheet" id="theme-link" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
    <link rel="stylesheet" id="iconlib-link" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css">
    <script src="../../../dist/jsoneditor.js"></script>
  </head>
  <body>
    <div class="container">
      <h1>Test</h1>
      <a href="https://github.com/json-editor/json-editor/issues/1536">Link to issue</a>
      <div id='editor_holder'></div>
    </div>

    <script>
      const value = document.querySelector('#value')
      const defaultSchema = {
        'title': 'Dependency chain support',
        'type': 'object',
        'properties': {
          'dependent_field_two': {
            'type': 'number',
            'options': {
              'dependencies': {
                'dependent_field_one': true
              }
            }
          },
          'dependent_field_one': {
            'type': 'boolean',
            'format': 'checkbox',
            'options': {
              'dependencies': {
                'dependency_chain_head': true
              }
            }
          },
          'dependency_chain_head': {
            'type': 'boolean',
            'default': false,
            'format': 'checkbox'
          }
        }
      }

      const editor = new JSONEditor(document.getElementById('editor_holder'), {
        iconlib: 'fontawesome5',
        schema: defaultSchema,
        theme: 'bootstrap3'
      })
    </script>
  </body>
</html>
